package com.dlx.statistics.controller;

import com.dlx.common.result.Result;
import com.dlx.order.client.ConsumeOrderInfoFeignClient;
import com.dlx.order.client.RechargeOrderInfoFeignClient;
import com.dlx.vo.order.ConsumeOrderReportQueryVo;
import com.dlx.vo.order.RechargeOrderReportQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <h3>smms_parent</h3>
 *
 * @author nglon
 * @description <p></p>
 * @date 2021-11-20 23:57
 **/
@RestController
@RequestMapping("/admin/statistics")
public class StatisticsController {

    @Autowired
    private RechargeOrderInfoFeignClient rechargeOrderInfoFeignClient;

    @Autowired
    private ConsumeOrderInfoFeignClient consumeOrderInfoFeignClient;

    @PostMapping("rechargeMonthlyReport")
    public Result getRechargeMonthlyReport(@RequestBody RechargeOrderReportQueryVo rechargeOrderReportQueryVo){
        return Result.ok(this.rechargeOrderInfoFeignClient.getMonthlyReport(rechargeOrderReportQueryVo));
    }

    @PostMapping("rechargeQuarterlyReport")
    public Result getRechargeQuarterlyReport(@RequestBody RechargeOrderReportQueryVo rechargeOrderReportQueryVo){
        return Result.ok(this.rechargeOrderInfoFeignClient.getQuarterlyReport(rechargeOrderReportQueryVo));
    }

    @GetMapping("rechargeAnnualReport")
    public Result getRechargeAnnualReport(){
        return Result.ok(this.rechargeOrderInfoFeignClient.getAnnualReport());
    }

    @PostMapping("consumeMonthlyReport")
    public Result getConsumeMonthlyReport(@RequestBody ConsumeOrderReportQueryVo consumeOrderReportQueryVo){
        return Result.ok(this.consumeOrderInfoFeignClient.getMonthlyReport(consumeOrderReportQueryVo));
    }

    @PostMapping("consumeQuarterlyReport")
    public Result getConsumeQuarterlyReport(@RequestBody ConsumeOrderReportQueryVo consumeOrderReportQueryVo){
        return Result.ok(this.consumeOrderInfoFeignClient.getQuarterlyReport(consumeOrderReportQueryVo));
    }

    @GetMapping("consumeAnnualReport")
    public Result getConsumeAnnualReport(){
        return Result.ok(this.consumeOrderInfoFeignClient.getAnnualReport());
    }

}
